package com.gy.api.mobile.app;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.github.pagehelper.PageInfo;
import com.gy.api.base.ApiIndex;
import com.gy.api.base.R;
import com.gy.api.base.RestPage;
import com.gy.api.pc.examine.domain.vo.*;
import com.gy.api.pc.examine.service.IExamineService;
import com.gy.api.pc.filings.domain.vo.PageScriptRecordVO;
import com.gy.api.pc.region.domain.vo.Region;
import com.gy.api.pc.region.service.IRegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.List;

@RestController
@RequestMapping("/app/handle/records")
@Api( tags = ApiIndex.RecordsController)
@Slf4j
@SaCheckLogin
public class RecordsController {

    @Autowired
    private IExamineService service;

    @GetMapping("/get_count")
    @ApiOperation("查询办事数量统计")
    public R<ExamineRecordVO> get_count() {
        ExamineRecordVO examineRecordVO=service.getCount();
        return new R(examineRecordVO);
    }

    @GetMapping("/get_completed_count")
    @ApiOperation("查询办事数量统计")
    public R<ExamineCompletedRecordVO> get_completed_count() {
        ExamineCompletedRecordVO examineRecordVO=service.getCompletedCount();
        return new R(examineRecordVO);
    }

    @GetMapping("/notSubmitted")
    @ApiOperation(value = "办理记录")
    public R<List<HandleRecordVO>> handleRecord(@ModelAttribute HandleRecordDto dto) {
        List<HandleRecordVO> list = service.handleRecord(dto);
        return  new R(list);
    }

    @GetMapping("/notSubmitted_page")
    @ApiOperation(value = "办理记录-分页")
    public R<List<HandleRecordVO>> notSubmitted_page(@ModelAttribute HandleRecordPageDto dto) {
        List<HandleRecordVO> list = service.handleRecordPage(dto);
        RestPage restPage = new RestPage( new PageInfo(list),list);
        return new R(restPage);
    }

}
